package com.hospital.hospitalsystem.modules.login.service;

import com.hospital.hospitalsystem.modules.login.dao.entity.UserEntity;
import com.hospital.hospitalsystem.modules.login.dao.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * @author qiancheng@cqxyy.net
 * @date 2023/2/22
 */
@Component
public class UserService {
    @Autowired
    private UserMapper userMapper;

    public void insertSelective(UserEntity user){
        userMapper.insertSelective(user);
    }

    public UserEntity selectOneByExample(Example example){
        return userMapper.selectOneByExample(example);
    }

    public List<UserEntity> selectByExample(Example example){
        return userMapper.selectByExample(example);
    }

    public void updateByExampleSelective(UserEntity userEntity,Example example) {
        userMapper.updateByExampleSelective(userEntity,example);
    }

    public void deleteByExample(Example example) {
        userMapper.deleteByExample(example);
    }
}
